package String;

import java.util.Scanner;

public class char_frenquency {
    public static void main(String[] args) {
        //统计字符串中大写字母，小写字母、数字字符出现频次
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter a string: ");
        String s = sc.next();

        int bigcount=0;
        int smallcount=0;
        int numcount=0;
        for(int i=0;i<s.length();i++)
        {
            char c = s.charAt(i);
            if(c>='a' && c<='z')
            {
                smallcount++;
            }
            else if(c>='A' && c<='Z')
            {
                bigcount++;
            }
            else if(c>='0' && c<='9'){
                numcount++;
            }
        }
        System.out.println("Big count: "+bigcount);
        System.out.println("Small count: "+smallcount);
        System.out.println("Num count: "+numcount);
    }
}
